<template>
	<view class="" :style="{ ...styleDefault}" @tap="click">
		{{text}}
	</view>
</template>

<script setup>
	const $emit = defineEmits()
	const props = defineProps({
		color: {
			type: [String, Number],
			default:'#ddd'
		},
		size: {
			type: [String, Number],
			default: '30rpx'
		},
		text: {
			type: String,
			default: '确定'
		},
		weight: {
			type: [String, Number],
			validator: (val) => {
				return ['400', '500', '600', '800', 'bold'].includes(val);
			}
		}
	});

	const styleDefault = {
		fontSize: props.size,
		fontWeight: props.weight,
		color: $use.colorObj().primary,
	};

	const click = () => {
		$emit('click');
	};
</script>

<style lang="scss" scoped>

</style>